with FT2.Types; use FT2.Types;
with FT2.Base; use FT2.Base;

--  Managing multiple sizes per face.
--
--  When creating a new face object (e.g., with New_Face), an
--  FT_Size object is automatically created and used to store all
--  pixel-size dependent information, available in the `face.size'
--  field.
--
--  It is however possible to create more sizes for a given face,
--  mostly in order to manage several character pixel sizes of the
--  same font family and style. See New_Size and Done_Size.
--
--  Note that Set_Pixel_Sizes and Set_Char_Size only
--  modify the contents of the current `active' size; you thus need
--  to use Activate_Size to change it.
--
--  99% of applications won't need the functions provided here,
--  especially if they use the caching sub-system, so be cautious
--  when using these.

package FT2.Sizes is

   pragma Elaborate_Body;

   procedure New_Size
     (Face : FT_Face;
      Size : out FT_Size;
      Error : out FT_Error);
   --  Create a new size object from a given face object.

   procedure Done_Size
     (Size : in out FT_Size;
      Error : out FT_Error);
   --  Discard a given size object.
   --  Note that Done_Face automatically discards all size objects
   --  allocated with New_Size.

   procedure Activate_Size
     (Size : FT_Size;
      Error : out FT_Error);
   --  Even though it is possible to create several size objects for a
   --  given face (see New_Size for details), functions like
   --  Load_Glyph or Load_Char only use the last-created one to
   --  determine the `current character pixel size'.
   --
   --  This function can be used to `activate' a previously created size object.

end FT2.Sizes;
